package com.hxzy.service.impl;

import com.hxzy.common.domain.AjaxResult;
import com.hxzy.common.utils.BCyrptUtil;
import com.hxzy.dto.AdminLoginDTO;
import com.hxzy.entity.AdminUser;
import com.hxzy.mapper.AdminUserMapper;
import com.hxzy.service.AdminUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.Set;

/**
 * 类说明
 *
 * @author admin
 * @date 2021-09-01
 */
@Service
@Transactional(rollbackFor = Exception.class)
public class AdminUserServiceImpl extends CommonServiceImpl<AdminUser,Integer> implements AdminUserService {

    private AdminUserMapper adminUserMapper;

    @Autowired
    public void setAdminUserMapper(AdminUserMapper adminUserMapper) {
        this.adminUserMapper = adminUserMapper;
        super.setMyBatisBaseDao(adminUserMapper);
    }


    @Override
    public AdminUser findByLoginName(String userName) {
        return this.adminUserMapper.selectByUserName(userName);
    }

    @Override
    public Set<String> findOwnRole(Integer userId) {
        return this.adminUserMapper.findOwnRole(userId);
    }

    @Override
    public Set<String> findOwnRoleOwnMenu(Integer userId) {
        return this.adminUserMapper.findOwnRoleOwnMenu(userId);
    }
}
